Home > C Programming > File Handling > Questions and Answers
Exercise:
01. | What are the files which are automatically opened when a C file is executed? | |||||||||||
|
02. | The statement that defines an input file handle called input_file, which is a pointer to type FILE, is | |||||||||||
|
03. | Using input_file, open the file results.dat for read mode. | |||||||||||
|
04. | Write C statements which tests to see if input_file has opened the data file successfully. If not, print an error message and exit the program. | |||||||||||
|
05. | Write C code which will read a line of characters (terminated by a \n) from input_file into a character array called buffer. NULL terminate the buffer upon reading a \n. | |||||||||||
|
06. | Choose the file associated with input_file. | |||||||||||
|
07. | What is the stand for FIFO? | |||||||||||
|
08. | What is a proper method of opening a file for writing as binary file? | |||||||||||||||
|
09. | How do you include a system header file called sysheader.h in a C source file? | |||||||||||||||
|
10. | Which one of the following is valid for opening a read-only ASCII file? | |||||||||||||||
|